package com.program.cloudmanagesystem.complaint.service;
import com.program.cloudmanagesystem.complaint.domain.Complaint;
import com.program.cloudmanagesystem.complaint.persistence.ComplaintMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ComplaintService {
    @Autowired
    private ComplaintMapper complaintMapper;

    public ComplaintService(){}
    public List<Complaint> showComplaints(){
        return complaintMapper.showComplaints();
    }
    public Complaint searchComplaint(String object){
        return complaintMapper.searchComplaint(object);
    }
    public void insertComplaint(Complaint complaint){
        complaintMapper.insertComplaint(complaint.getName(),complaint.getTime(),complaint.getPhone(),complaint.getObject(),complaint.getContent(),complaint.getDoingcontent(),complaint.getScore(),complaint.getState());
    }
    public void updateData(Complaint complaint)
    {
        complaintMapper.updateData(complaint.getName(),complaint.getTime(),complaint.getPhone(),complaint.getObject(),complaint.getContent(),complaint.getDoingcontent(),complaint.getDonecontent(),complaint.getReply(),complaint.getScore(),complaint.getState(),complaint.getDoingtime(),complaint.getDonetime(),complaint.getReplytime());
    }
}
